<template>
	<view class="page notice-detail">
		<nav-header title="账单详情" :show-right="false">
		</nav-header>

		<view class="header">
			<view class="header-item" v-if="detailData.type == 0">
				<img :src="getResource('/icon/chongzhi.svg')" class="detail-img">
				<text>平台充值</text>
				<text class="money">+{{ detailData.money }}</text>
			</view>
			<view class="header-item" v-if="detailData.type == 1">
				<img :src="getResource('/icon/tixian.svg')" class="detail-img">
				<text>提现通知</text>
				<text class="money">-{{ detailData.money }}</text>
			</view>
		</view>

		<view class="info">
			<view class="info-item">
				<view class="title">当前状态</view>
				<text class="data">{{ detailData.status }}</text>
			</view>
			<view class="info-item">
				<view class="title">支付时间</view>
				<text class="data">{{ detailData.payTime }}</text>
			</view>
			<view class="info-item">
				<view class="title">商品</view>
				<text class="data">{{ detailData.goods }}</text>
			</view>
			<view class="info-item">
				<text class="title">商户全称</text>
				<text class="data" v-if="detailData.type == 1">{{ detailData.way }}</text>
				<text class="data" v-if="detailData.type == 0">{{ detailData.company }}</text>
			</view>
			<view class="info-item">
				<view class="title">收单机构</view>
				<text class="data">{{ detailData.company }}</text>
			</view>
			<view class="info-item">
				<view class="title">支付方式</view>
				<text class="data" v-if="detailData.type == 0">{{ detailData.way }}</text>
				<text class="data" v-if="detailData.type == 1">{{ detailData.payWay }}</text>
			</view>
			<view class="info-item">
				<view class="title">交易单号</view>
				<text class="data">{{ detailData.payId }}</text>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			detailData: {}
		}
	},
	methods: {

	},
	onLoad(options) {
		let item = JSON.parse(decodeURIComponent(options.data));
		console.log(item);
		this.detailData = item
	}
}
</script>

<style lang="less" scoped>
.notice-detail {
	.header {
		padding: 30rpx;

		.header-item {
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;

			.money {
				font-weight: 600;
				color: #000;
				font-size: 55rpx;
			}

			text {
				margin-top: 40rpx;
				font-size: 38rpx;
			}

			.detail-img {
				width: 160rpx;
				height: 160rpx;
			}
		}
	}

	.info {
		padding: 0 40rpx;
		font-size: 28rpx;
		color: #757575;

		.info-item {
			display: flex;
			margin-top: 30rpx;

			.title {
				width: 140rpx;
			}

			.data {
				color: #000;
				margin-left: 20rpx;
			}
		}
	}
}
</style>